<% content_for :left_sidebar do  %>
  <%= render :partial => "layouts/sidebar/xiwenguanli" %>
<% end %>
<%- model_class = Weixin -%>
<div class="page-header">
  <h1>微信稿件 - 详情</h1>
</div>

<dl class="dl-horizontal">
  <dt><strong>发稿人:</strong></dt>
  <dd><%= @weixin.postby %></dd>
  <dt><strong>正文:</strong></dt>
  <dd><%=raw @weixin.content %></dd>
  <dt><strong>审核状态:</strong></dt>
  <dd><%= @weixin.check_text %></dd>
  <% if @weixin.check == 3 %>
      <dt><strong>未采用原因:</strong></dt>
      <dd><%= @weixin.reason %></dd>
  <% end %>
  <dd>
    <%= form_tag reject_admins_weixin_path do %>
        <% if @weixin.check == 0 %>
            <%= link_to '确认送审',submit_admins_weixin_path(@weixin),:class => 'btn btn-primary' %>
        <% end %>
        <%= link_to '返回',admins_weixins_path,:class => 'btn btn-info' %>
        <% if Weixin.can_approve?(@weixin,current_user) %>
            <%= link_to '确认采用',approve_admins_weixin_path(@weixin),:class => 'btn btn-primary btn-success' %>
            <%= hidden_field_tag :id,@weixin.id %>
            <%= submit_tag '确认不采用',:class => 'btn btn-primary btn-danger' %>
            <div style="margin-top: 5px;">
              <%= must_label %>如果不采用,请填写不采用原因:
              <%= text_field_tag :reason,'',required: "required" %>
            </div>
        <% end %>
    <% end %>
  </dd>
</dl>
